package eu.livotov.jsms;

/**
 * Created by IntelliJ IDEA.
 * User: dlivotov
 * Date: 26.11.11
 * Time: 14:54
 * To change this template use File | Settings | File Templates.
 */
public class SMSException extends RuntimeException
{
    public final static int ERROR_UNEXPECTED = Integer.MAX_VALUE;

    private int errorCode;

    public SMSException(int providerCode, final String providerMessage)
    {
        super(providerMessage);
        this.errorCode = providerCode;
    }

    public SMSException(Throwable cause)
    {
        super("Unexpected error: " + cause.getMessage(), cause);
        this.errorCode = ERROR_UNEXPECTED;
    }

    public int getErrorCode()
    {
        return errorCode;
    }
}
